


export const constantRoute = [

    {
        //登录
        path: '/login',
        component: () => import('@/view/login.vue'),
        name: 'login',
        meta: {
            title: '登录',
            hidden: true,
            icon: 'promotion'
        }
    },
    {
        //主页
        path: '/',
        component: () => import('@/view/home.vue'),
        name: 'home',
        meta: {
            title: '主页',
            hidden: true,
            icon: 'HomeFilled',
            requiresAuth: true // 添加一个标记，表明该页面需要授权
        },
        redirect: '/news',
        children: [
            {
                path: '/news',
                name: 'News',
                component: () => import('@/view/news.vue'),
                meta: { activeTab: 'news' },
                children: [
                    // 添加聊天页面的路由
                    {
                        path: '/chat/:id/:roomName',  // 使用动态参数:id来接收好友的ID
                        name: 'ChatRoom',
                        component: () => import('@/components/room.vue'),
                        props: true,  // 启用 props，这样路由参数就能直接作为组件的 props
                        meta: { activeTab: 'chat' },
                    },
                ]
            },

            {
                path: '/friends',
                name: 'Friends',
                component: () => import('@/view/friends.vue'),
                meta: { activeTab: 'friends' },
                children: [


                    // 添加聊天页面的路由
                    {
                        path: '/frien/:id/:roomName',  // 使用动态参数:id来接收好友的ID
                        name: 'frienRoom',
                        component: () => import('@/components/friend.vue'),
                        props: true,  // 启用 props，这样路由参数就能直接作为组件的 props
                        meta: { activeTab: 'frien' },
                    },
                    {
                        path:'/newfriends',
                        name:'newfriends',
                        component:()=>import('@/components/newfriends.vue'),
                        props: true,  // 启用 props，这样路由参数就能直接作为组件的 props
                        meta: { activeTab: 'newfriend' },
                    }


                ]
            },

        ]
    }
]